﻿@{
    Layout = "";
}
@model Nop.Plugin.Nova.Janrain.Models.JanrainModel
@using Nop.Web.Framework;
@if (Model.IsEnable)
{
<script type="text/javascript">
    (function () {
        if (typeof window.janrain !== 'object') window.janrain = {};
        if (typeof window.janrain.settings !== 'object') window.janrain.settings = {};

        janrain.settings.tokenUrl = '@Model.StoreUrl' + '@Url.Action("JanrainProcess","NovaJanrain")';

        function isReady() { janrain.ready = true; };
        if (document.addEventListener) {
            document.addEventListener("DOMContentLoaded", isReady, false);
        } else {
            window.attachEvent('onload', isReady);
        }

        var e = document.createElement('script');
        e.type = 'text/javascript';
        e.id = 'janrainAuthWidget';

        if (document.location.protocol === 'https:') {
            e.src = 'https://rpxnow.com/js/lib/nopcomerce/engage.js';
        } else {
            e.src = 'http://widget-cdn.rpxnow.com/js/lib/nopcomerce/engage.js';
        }

        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(e, s);
    })();
 </script>

<table width="100%" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <div id="janrainEngageEmbed"></div>
        </td>
    </tr>
    @*<tr>
        <td>
            Author: Aliva Zheng | Email: zhenghl@shinetechchina.com
        </td>
    </tr>*@
</table>
    <br />
}